<?php
namespace Home\Controller;
use Think\Controller;
class PromoterController extends AuditBaseController {
    
    public function center(){
        $this->assign('page_name', '个人中心');
        
        //region 控制分成比例页、推荐下线页是否显示
        $promoter_id = cookie('jh_login_user');
        $curr_promoter_en = M('promoterInfo')->where("promoter_id='%s'",$promoter_id)->find();
        $isShowSubRevenueManager = 0;
        if($curr_promoter_en['has_superior'] == 0 && $curr_promoter_en['has_subordinate'] == 1){
            $isShowSubRevenueManager = 1;
        }
        $this->assign('isShowSubRevenueManager', $isShowSubRevenueManager);
        //endregion 控制分成比例页、推荐下线页是否显示

    	$this->display("promoter/center");
    }
    
    
    public function info(){
    	$this->assign('page_name', '个人信息');
    	
    	$promoter_id = I('promoter_id');
    	$curr_promoter_en = M('promoterInfo')->where("promoter_id='%s'",$promoter_id)->find();
    	
    	$this->assign('curr_promoter_en', $curr_promoter_en);
    	$this->assign('curr_promoter_en_json', json_encode($curr_promoter_en));
    	$this->display("promoter/info");
    }
    
    
    /**
     * 账户页面
     */
    public function account(){
    	$this->assign('page_name', '我的账户');
    	
    	
    	
    	$this->display("promoter/account");
    }
    
    
    /**
     * 账户明细
     */
    public function amountList(){
    	$this->assign('page_name', '账户明细');
    	
    	$this->display("promoter/amountList");
    }
    
    
   
    
    
    /**
     * 修改密码
     */
    public function changePwd(){
    	$this->assign('page_name', '修改密码');
    	 
    	$this->display("promoter/changePwd");
    }
    
    
    /**
     * 申请提现页面
     */
    public function requestWithdraw(){
    	$this->assign('page_name', '申请提现');
    	
    	$this->display("promoter/requestWithdraw");
    }
    
    public function withdrawDetail(){
    	$this->assign('page_name', '提现明细');
    	 
    	$this->display("promoter/withdrawDetail");
    }
    

    /**
     * 下级推广人分成比例管理页
     */
    public function subRevenueManager(){
        $this->assign('page_name', '分成比例管理页');
        
        $this->display("promoter/subRevenueManager");
    }
    
    /**
     * 成为推广大使扫描页
     */
    public function scanjoin(){
    	$this->assign('page_name', '加入o2o云推广');
    	 
    	$this->display("promoter/scanjoin");
    }
    
    
    public function scanbuy(){
    	$this->assign('page_name', '扫描二维码购物 ');
    	
    	$this->display("promoter/scanbuy");
    }
}
